
<div class="row">
	<div class="col-md-12">
		<ol class="breadcrumb">
			<li><a href="#" onclick="common_ajax.ajaxMainPanel('/jf/test/index/content');">${i18nMap["admin.common.mainPage"]}</a></li>
			<li class="active">博客管理</li>
		</ol>
	</div>
</div>
						
<form id="splitPage" class="form-horizontal" action="${cxt!}/jf/test/blog" method="POST">
	
	<div class="row">
		<div class="col-md-12">
			<!-- start: BORDERED TABLE PANEL -->
			<div class="panel panel-white">
				
				<div class="panel-heading">
					<h4 class="panel-title"><span class="text-bold">博客查询</span></h4>
					<div class="panel-tools">										
						<% include("/common/panel-tools.html"){} %>
					</div>
				</div>
				
				<div class="panel-body">		
				  	<div class="form-group">
				  	
						<label class="col-sm-2 control-label" for="focusedInput">标题</label>
						<div class="col-sm-4">
						 	<input class="form-control focused" type="text" 
						 	name="_query.title" value='${escapeXml(paramMap["_query.title"])}' 
						 	maxlength="50" >
						</div>
								
						<label class="col-sm-2 control-label" for="focusedInput">内容</label>
						<div class="col-sm-4">
						 	<input class="form-control focused" type="text" 
						 	name="_query.content" value='${escapeXml(paramMap["_query.content"])}' 
						 	maxlength="50" >
						</div>

				  	</div>
				  	
					<div class="form-group">
						<div class="col-sm-5 col-sm-offset-5">
							<button type="button" class="btn btn-primary" onclick='common_ajax.ajaxFormMainPanel("splitPage");'>${i18nMap["admin.common.select"]}</button>
							<button type="reset" class="btn">${i18nMap["admin.common.reset"]}</button>
						</div>
				  	</div>
				</div>
			
			</div>
		</div>
	</div>
	
	<div class="row">
		<div class="col-md-12">
			<!-- start: BORDERED TABLE PANEL -->
			<div class="panel panel-white">
				
				<div class="panel-heading">
					<h4 class="panel-title">
						<span class="text-bold">博客列表</span>
					</h4>
					<div class="panel-tools">										
						<% include("/common/panel-tools.html"){} %>
					</div>
				</div>
				
				<%
					var edit = authUrl("/jf/test/blog/edit");
					var delete = authUrl("/jf/test/blog/delete");
					var view = authUrl("/jf/test/blog/view");
				%>
				
				<div class="panel-body">
					
					<div class="row">
						<div class="col-md-12 space20">
						
							<% if(authUrl("/test/blog/add.html")){ %>
								<button type="button" class="btn btn-success add-row" 
									onclick="common_ajax.ajaxMainPanel('/jf/test/blog/toUrl?toUrl=/test/blog/add.html');">
									添加博客 <i class="fa fa-plus"></i>
								</button>
							<% } %>	
							
							<% if(delete == true){ %>
								<button type="button" class="btn btn-red delete-row" 
									data-bb="deleteList" data-url="/jf/test/user/delete"> 
									${i18nMap["admin.common.delete"]} <i class="fa fa-trash-o"></i>
								</button>
							<% } %>

						</div>
					</div>
					
					<table class="table table-bordered table-hover" id="dataTable">
						<thead>
							<tr>
							
								<th class="center hidden-xs" width="50">
									<input type="checkbox" name="checkAll" class="flat-grey selectall" 
										onchange="common_common.checkFunc('dataTable', this.checked);"> 
								</th>
								<th class="hidden-xs" onclick="common_splitPage.orderbyFun(
										'mainPanel', 'splitPage', 'title')">
									标题	${orderBy("title")}
								</th>
								<th class="hidden-xs" onclick="common_splitPage.orderbyFun(
										'mainPanel', 'splitPage', 'createtime')">
									创建时间	${orderBy("createtime")}
								</th>
								<th class="hidden-xs">
									${i18nMap["admin.common.operation"]}
								</th>

							</tr>
						</thead>
						<tbody>
							
							<% for(blog in splitPage.list){ %>
							<tr>
								<td class="center hidden-xs">
									<input type="checkbox" name="checkIds" 
										value="${user.ids!}" class="flat-grey foocheck">
								</td>
								<td>
									<span class="label label-sm label-success">
										${escapeXml(blog["title"]!)}
									</span>
								</td>
								<td>
									${blog.createtime !, dateFormat="yyyy-MM-dd HH:mm:ss.SSS"}
								</td>
								<td class="hidden-xs">
									<% if(view == true){ %>
									<button type="button" class="btn btn-dark-yellow add-row" 
										onclick="common_ajax.ajaxMainPanel(
												'/jf/test/blog/view/${blog.ids!}');">
										${i18nMap["admin.common.see"]} <i class="fa fa-eye"></i>
									</button>
									<% } %>
										
									<% if(edit == true){ %>
									<button type="button" class="btn btn-green edit-row" 
										onclick="common_ajax.ajaxMainPanel(
												'/jf/test/blog/edit/${escapeXml(blog.ids!)}');"> 
										${i18nMap["admin.common.edit"]} 
										<i class="fa fa-edit"></i>
									</button>
									<% } %>
									
									<% if(delete == true){ %>
									<button type="button" class="btn btn-red delete-row" 
										data-bb="deleteOne" 
										data-url="/jf/test/blog/delete/${blog.ids!}"> 
										${i18nMap["admin.common.delete"]} 
										<i class="fa fa-trash-o"></i>
									</button>
									<% } %>
								</td>
							</tr>
							<% } %>
							
						</tbody>
					</table>
					
					<div class="row" id="splitPageDiv">
						<% include("/common/splitPage.html", {"divId" : "mainPanel", "formId" : "splitPage", "splitPageDiv" : "splitPageDiv"}){} %>
					</div>
					
				</div>
			
			</div>
			<!-- end: BORDERED TABLE PANEL -->
		</div>
	</div>
	
</form>			

<script type="text/javascript">
	jQuery(document).ready(function() {
		common_form.init();
	});
</script>
